home *** CD-ROM | disk | FTP | other *** search
ASP.NET Web Form | 2002-03-17 | 2.0 KB | 47 lines |
- <%@ Page Language="vb" AutoEventWireup="false" Codebehind="DynamicTemplateForm.aspx.vb" Inherits="DataBinding.DynamicTemplateForm" %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <HTML>
- <HEAD>
- <title>DynamicTemplateForm</title>
- <meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
- <meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
- <meta content="JavaScript" name="vs_defaultClientScript">
- <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
- </HEAD>
- <body>
- <form id="Form1" method="post" runat="server">
- <H1 style="FONT-WEIGHT: bold; FONT-SIZE: large">Dynamic Template Demo</H1>
- <P style="FONT-WEIGHT: bold; FONT-SIZE: large"><FONT style="FONT-WEIGHT: normal" size="3">This
- page demonstrates that you can load a template dynamically from an .ascx file
- and that you can even create a custom template class that lets you be in full
- control of how data is displayed in a Repeater, DataList, or DataGrid control.</FONT></P>
- <P style="FONT-WEIGHT: bold; FONT-SIZE: large"><FONT size="3"></FONT> </P>
- <P>Item Template:
- <asp:dropdownlist id="ddlItemTemplate" runat="server" Width="179px" AutoPostBack="True"></asp:dropdownlist>
- Alternate Item Template
- <asp:dropdownlist id="ddlAlternateTemplate" runat="server" Width="179px" AutoPostBack="True"></asp:dropdownlist></P>
- <P>
- <asp:Button id="btnCustom" runat="server" Width="122px" Text="Custom Template"></asp:Button></P>
- <P><asp:datalist id="DataList1" runat="server" Width="604px">
- <ItemTemplate>
- <div>
- <b>
- <%# Container.DataItem("Title") %>
- </b>-
- <%# Container.DataItem("price") %>
- </div>
- </ItemTemplate>
- <AlternatingItemTemplate>
- <div>
- <b>
- <%# Container.DataItem("Title") %>
- </b>-
- <%# Container.DataItem("price") %>
- </div>
- </AlternatingItemTemplate>
- </asp:datalist></P>
- <P> </P>
- </form>
- </body>
- </HTML>
-